package com.ztgf.commodity.models.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.ztgf.commodity.models.bo.BrandInfoBO;
import com.ztgf.commodity.models.bo.BrandInfoSaveBO;
import com.ztgf.commodity.models.dto.BrandInfoDTO;
import com.ztgf.commodity.models.vo.BrandInfoVO;
import com.ztgf.commodity.models.vo.CategoryAdminDetailsNewVO;
import com.ztgf.commodity.models.vo.CategoryBrandVO;
import com.ztgf.commodity.models.vo.CommodityShopBrandVO;

import java.util.List;

/**
 * author: chenyu.wang
 * date: 2020-05-25 13:52
 * Description:
 */
public interface IBrandInfoService extends IService<BrandInfoDTO> {

    /**
     * description: 添加商品品牌
     * param: [saveBO]
     * author: chenyu.wang
     * date: 2020-05-25
     * return: boolean
     */
    boolean addBrand(BrandInfoSaveBO saveBO);

    /**
     * description: 逻辑删除/恢复商品品牌,删除时下架关联商品
     * param: [id]
     * author: chenyu.wang
     * date: 2020-05-25
     * return: boolean
     */
    boolean deleteLogic(Long id);

    //后台管理
    Page<BrandInfoVO> queryPageList(Page<BrandInfoVO> page, BrandInfoBO brandInfoBO);//品牌列表

    /**
     * description: 查询店铺下所有品牌
     * param: [shopId]
     * author: chenyu.wang
     * date: 2020-07-23
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityShopBrandVO>
     */
    List<CommodityShopBrandVO> queryShopBrandList(Long shopId);

    /**
     * description: 查询店铺下所有品牌
     * param: [shopId]
     * author: chenyu.wang
     * date: 2020-07-23
     * return: java.util.List<com.ztgf.commodity.models.vo.CommodityShopBrandVO>
     */
    List<CommodityShopBrandVO> queryShopBrandListByShopIdAndBrandId(Long shopId,Long brandId);


    BrandInfoDTO getByName(String name);

    boolean updateByName(String name);

    List<BrandInfoDTO> queryList(String initials, Long shopId);

    CategoryBrandVO checkBrand(String brandName);

    /**
     * @Description: 根据类目id获取品牌信息
     * @Author: chenyu.wang
     * @Params: [categoryId]
     * @Date: 2020.11.10 14:45
     */
    List<BrandInfoDTO> queryBrandByCategoryId(Long categoryId);

    /**
     * @Description: 处理导入的数据
     * @Author: chenyu.wang
     * @Params: [brandNames, brandList]
            * @Date: 2020.11.30 15:58
            */
    List<CategoryBrandVO> getImportDate(List<CategoryBrandVO> brandNames, List<CategoryBrandVO> brandList, CategoryAdminDetailsNewVO category);

    /**
     * @Description: 后台类目管理导入属性返回导入的信息
     * @Author: chenyu.wang
     * @Params: [input, id]
     * @Date: 2020.11.24 10:56
     */
    CategoryAdminDetailsNewVO importAttributes(byte[] input, Long id);

}
